package com.cynteka.cyfoman.core.collection;

import java.io.File;
import java.io.FileFilter;

/**
 * User: Sergey
 * Date: 04.08.11
 * Time: 11:38
 */
public class HiddenFileFilter implements FileFilter {
    private final boolean filterHiddenFiles;

    public HiddenFileFilter(boolean filterHiddenFiles) {
        this.filterHiddenFiles = filterHiddenFiles;
    }

    @Override
    public boolean accept(File pathname) {
        if (filterHiddenFiles) {
            boolean res = !pathname.isHidden();
            return res;
        }
        return true;
    }
}
